entry: Move cairo_save() call for clarity
authorBenjamin Otte <otte@redhat.com>
Mon, 18 Apr 2011 23:13:57 +0000 (01:13 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 19 Apr 2011 20:18:19 +0000 (22:18 +0200)
We want save, clip, draw1, restore, save, clip, draw2, restore
and not save, save, clip, draw1, restore, clip, draw2, restore

Functionally the same thing, but not as obvious

gtk/gtkentry.c

index b1788601cf2ad233bfaf81aa32659328de28473a..9b324359b6956f643413b62cef026b17019939a2 100644 (file)
@@ -5774,8 +5774,6 @@ gtk_entry_draw_text (GtkEntry *entry,
 
       cairo_save (cr);
 
-      cairo_save (cr);
-
       cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
       cairo_rectangle (cr, 0, 0, width, height);
 
@@ -5791,6 +5789,8 @@ gtk_entry_draw_text (GtkEntry *entry,
       draw_text_with_color (entry, cr, &text_color);
       cairo_restore (cr);
 
+      cairo_save (cr);
+
       cairo_rectangle (cr, progress_x, progress_y,
                        progress_width, progress_height);
       cairo_clip (cr);